import {request} from '@/utils/request'
import type{ KnowledgePageType,KnowledgeParams,DoctorParams,DoctorPageType,FollowType,TopDep, Image } from '@/types/consult'

//首页-查询推荐/减脂/饮食健康/关注页面--百科文章列表
export const getKnowLedgePageAPI = (params:KnowledgeParams)=>request<KnowledgePageType>('/patient/home/knowledge','GET',params)

//关注的医生列表
export const getConcernDoctorListAPI = (params:DoctorParams) => request<DoctorPageType>('/home/page/doc','GET',params)

//关注医生
export const likeDoctorAPI = (id:string,type:FollowType='doc') =>request('/like','POST',{id,type})

//获取科室
export const getAllDepAPI = () => request<TopDep[]>('/dep/all')

//上传图片
export const uploadFileAPI = (file:File) => {
    const fd = new FormData()
    fd.append('file',file)
    return request<Image>('/upload','POST',fd )
}
